#!/bin/bash

set -e
n 10
cd `dirname $0`/..

script/set-version $1
script/release-web-ext-host $1
# script/pkg-nodejs $1
echo "release electron version" $1

cd localnative-electron
# rm -f package-lock.json
# rm -rf node_modules
npm i
npm run build
rm -rf node_modules/localnative-neon/native/target
electron-builder -c electron-builder.yaml

DIR="../../localnative-release/v$1/mac/"
mkdir -p $DIR
FILE="Local Native-$1.dmg"
cp "release/$FILE" $DIR/
cd $DIR
shasum -a 256 "$FILE" > "$FILE.sha256"
md5 "$FILE" > "$FILE.md5"

